<template>
  <a-spin :spinning="confirmLoading">
    <a-form-model ref="form" :model="models" :rules="validatorRules">
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productCompanyName" required label="公司/产品名称">
        <a-textarea
          :rows="5"
          v-model="models.productCompanyName"
          placeholder="牛仔半身裙"
        />
      </a-form-model-item>
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productIntroduction" required label="产品介绍">
        <a-textarea
          :rows="5"
          v-model="models.productIntroduction"
          placeholder="显瘦A字版型，复古牛仔蓝"
        />
      </a-form-model-item>
    </a-form-model>
  </a-spin>
</template>

<script>
export default {
  name: 'ShippingTitle',
  components: {},
  props: {
    model: {
      type: Object,
      default: {},
    },
  },

  data() {
    return {
      addIconShow: true,
      shoppIngIcon: '',
      models: this.model,
      confirmLoading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 12 },
      },
      validatorRules: {
        productCompanyName: [
          { required: true, message: '请输入公司/产品名称' },
          { min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' },
        ],
        productIntroduction: [
          { required: true, message: '请输入产品介绍' },
          { min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' },
        ],

      },
    }
  },

  created() {},

  updated() {},
  mounted() {
    this.$nextTick(function () {
      console.log('11111111111111111', this.models)
    })
  },
  methods: {
    generatedBtnProp() {
      let obj = {
        productCompanyName: this.models.productCompanyName,
        productIntroduction: this.models.productIntroduction,

      }
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('appApiAsk', 1, obj)
        } else {
          this.$emit('appApiAsk', 2, obj)
        }
      })
    },
  },
}
</script>

<style lang="less">
</style>